package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SuperCategory;
import com.ruoyi.system.mapper.SuperCategoryMapper;
import com.ruoyi.system.service.ISuperCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品分类Service业务层处理
 * 
 * @author xjf
 * @date 2025-08-12
 */
@Service
public class SuperCategoryServiceImpl implements ISuperCategoryService 
{
    @Autowired
    private SuperCategoryMapper superCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public SuperCategory selectSuperCategoryById(Long id)
    {
        return superCategoryMapper.selectSuperCategoryById(id);
    }

    /**
     * 查询商品父级分类列表
     *
     * @param superCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<SuperCategory> selectSuperCategoryFatherList(SuperCategory superCategory)
    {
        return superCategoryMapper.selectSuperCategoryFatherList(superCategory);
    }
    /**
     * 查询商品分类列表
     * 
     * @param superCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<SuperCategory> selectSuperCategoryList(SuperCategory superCategory)
    {
        return superCategoryMapper.selectSuperCategoryList(superCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param superCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertSuperCategory(SuperCategory superCategory)
    {
        return superCategoryMapper.insertSuperCategory(superCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param superCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateSuperCategory(SuperCategory superCategory)
    {
        return superCategoryMapper.updateSuperCategory(superCategory);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSuperCategoryByIds(Long[] ids)
    {
        return superCategoryMapper.deleteSuperCategoryByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSuperCategoryById(Long id)
    {
        return superCategoryMapper.deleteSuperCategoryById(id);
    }
}
